#-------------------------------------------------------------------------------
# Name:        ioeng
# Purpose:     Function interface for IOEngine.pyd
#
# Author:      SUPER_紫电  QQ:911344755
#
# Created:     11/11/2022
# Copyright:   (c) SUPER_紫电 2022 All rights reserved.
# Licence:     <Modified BSD License>
#-------------------------------------------------------------------------------

import IOEngine as ioeng

def init_drv(pid)->bool: return ioeng.init_drv(pid)
def deinit_drv()->bool: return ioeng.deinit_drv()

def set_reg_addr(base, alt, dev)->None:
    return ioeng.set_reg_addr(base, alt, dev)

def inp(port)->int: return ioeng.inp(port)
def inpw(port)->int: return ioeng.inpw(port)
def inpd(port)->int: return ioeng.inpd(port)
def outp(port, value)->None: return ioeng.outp(port, value)
def outpw(port, value)->None: return ioeng.outpw(port, value)
def outpd(port, value)->None: return ioeng.outpd(port, value)

def read_pci_config_byte(pci_address, reg_address)->int:
    return ioeng.read_pci_config_byte(pci_address, reg_address)
def read_pci_config_word(pci_address, reg_address)->int:
    return ioeng.read_pci_config_word(pci_address, reg_address)
def read_pci_config_dword(pci_address, reg_address)->int:
    return ioeng.read_pci_config_dword(pci_address, reg_address)

def read_data(offset, sectors, timeout=10)->bool:
    return ioeng.read_data(offset, sectors, timeout)
def write_data(offset, sectors, timeout=10)->bool:
    return ioeng.write_data(offset, sectors, timeout)

